
// 输出本地时间，如：2025-04-02 13:48:30
function getLocalTime() {
    const now = new Date();
    const year = now.getFullYear();
    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始
    const day = String(now.getDate()).padStart(2, '0');
    const hours = String(now.getHours()).padStart(2, '0');
    const minutes = String(now.getMinutes()).padStart(2, '0');
    const seconds = String(now.getSeconds()).padStart(2, '0');
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function getRandom4DigitNumber() {
    return Math.floor(1000 + Math.random() * 9000);
}

module.exports = {
    getLocalTime,
    getRandom4DigitNumber
};
